#include "SaveButtonListener.h"

SaveButtonListener::SaveButtonListener(ScenarioPanel* panel) {
	this->panel = panel;
}

SaveButtonListener::~SaveButtonListener() {
	this->panel = NULL;
}

void SaveButtonListener::execute(){
	this->panel->save();
	SDL_Event event;
	event.type = SDL_USEREVENT;
	event.user.code = load;
	event.user.data1 = 0;
	event.user.data2 = 0;
	SDL_PushEvent(&event);

	SDL_Event event2;
	event2.type = SDL_VIDEORESIZE;
	event2.resize.w = LOAD_WIDTH_RESOLUTION;
	event2.resize.h = LOAD_HEIGHT_RESOLUTION;
	SDL_PushEvent(&event2);
}
